﻿#define _CRT_SECURE_NO_WARNINGS 1

//编程初学者入门训练第二十六题
//BC28 大小写转换
//https://www.nowcoder.com/practice/4e089ee8966a4ed4b306f64e68d45264?tpId=107&tqId=33309&rp=1&ru=/exam/oj/ta&qru=/exam/oj/ta&sourceUrl=%2Fexam%2Foj%2Fta%3FtpId%3D107&difficulty=undefined&judgeStatus=undefined&tags=&title=


//第一种ASCII码
#include <stdio.h>

int main() {
    char ch;
    while (scanf("%c", &ch) != EOF) {
        if (ch >= 'a' && ch <= 'z') {
            printf("%c\n", ch - 32);
        }
        if (ch >= 'A' && ch <= 'Z') {
            printf("%c\n", ch + 32);
        }

    }
    return 0;
}

//库函数的tolower和toupper
#include <stdio.h>
#include <ctype.h>

int main() {
    char ch;
    while (scanf("%c", &ch) != EOF) {
        if (ch >= 'a' && ch <= 'z') {
            putchar(toupper(ch));
            printf("\n");
        }

        if (ch >= 'A' && ch <= 'Z') {
            putchar(tolower(ch));
            printf("\n");
        }

    }
    return 0;
}

